<template>
  <div>
    <div class="title" @click="change">
      <slot name="title"></slot>
      <!--name='title'区分插槽 -->
    </div>
    <div class="sub" v-show="flag">
      <slot></slot>
    </div>
  </div>

</template>

<script>
export default {
  name: "SubMenu",
  data(){
    return {flag:false}
  },
  methods:{
    change(){
      this.flag=!this.flag
    }
  }
}
</script>

<style scoped>

</style>
